<?php
/**
 * @Author: lianlianzan(13040@qq.com)
 * @Date:   2018-08-18 16:40:16
 * @Last Modified by:   lianlianzan
 * @Last Modified time: 2021-01-13 15:53:25
 */

namespace app\mobmall_manage\controller;
use app\common\controller\Backend;

class Index extends Backend {

	function initialize() {
		parent::initialize();
		$this->saveAndGetConfigIdentify('', '管理首页', '', 'index');
	}

	/**
	 * 首页
	 */
	public function index() {
// 		$productDao = model('Product');
// 		$orderDao = model('Order');
// 		$orderRefundDao = model('OrderRefund');
// 		$userDao = model('User');
// 		
// 		//商品总数
// 		$productNum = $productDao->countSearch([]);
// 		$this->assign('productNum', $productNum);
// 
// 		//用户总数
// 		$userNum = $userDao->countSearch([]);
// 		$this->assign('userNum', $userNum);
// 		
// 		//订单总数量
// 		$orderNum = $orderDao->countSearch([]);
// 		$this->assign('orderNum', $orderNum);
// 
// 		//订单今日数量
// 		$orderTodayNum = $orderDao->countSearch(['create_time'=>array('gt', $this->tdtime)]);
// 		$this->assign('orderTodayNum', $orderTodayNum);
// 
// 		//订单总交易额
// 		$orderSumAmount = $orderDao->sumSearch(['pay_status'=>2]);
// 		$this->assign('orderSumAmount', $orderSumAmount);
// 		
// 		//订单今日交易额
// 		$orderTodayAmount = $orderDao->sumSearch(['pay_status'=>2, 'create_time'=>array('gt', $this->tdtime)]);
// 		$this->assign('orderTodayAmount', $orderTodayAmount);
// 		
// 		//退款申请记录
// 		$orderRefundNum = $orderRefundDao->countSearch(['status'=>1], '');
// 		$this->assign('orderRefundNum', $orderRefundNum);
// 		
// 		//退款今日申请记录
// 		$orderRefundTodayNum = $orderRefundDao->countSearch(['status'=>1, 'create_time'=>array('gt', $this->tdtime)], '');
// 		$this->assign('orderRefundTodayNum', $orderRefundTodayNum);
// 		
		//前台地址展示
		$prodUrl = config('system.site_share_domain').'/mobmall/index/index';
		$httpsUrl = config('system.site_https_domain').'/mobmall/index/index';
		$devUrl = config('system.site_host').'/mobmall/index/index';
		$this->assign('prodUrl', $prodUrl);
		$this->assign('httpsUrl', $httpsUrl);
		$this->assign('devUrl', $devUrl);

		//产品使用说明书
// 		$text = file_get_contents(CMF_ROOT.'/README.md');
// 		require_once(EXTEND_PATH."HyperDown/Parser.php");
// 		$parser = new \HyperDown\Parser();
// 		$instructionHtml = $parser->makeHtml($text);
// 		$this->assign('instructionHtml', $instructionHtml);

		return $this->fetch();
	}

}